home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
BOB2
/
BOB2_1
/
!ArmBob
/
progs
/
Apply
< prev
next >
Wrap
Text File
|
1994-12-12
|
349b
|
21 lines
/* Example Apply */
/* functions and vectors can be arguments or components */
apply(pair)
{
return pair[function](pair[argument]);
}
f(x) // f takes functions as arguments
{ return x(0); }
g(x)
{ return (100+x); }
main()
{
enum { function, argument };
x = vector { f; g; }; // a vector of functions
print(apply(x),"\n");
}